package com.sztx.pay.center.dataaccess.dao.mysql;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.sztx.pay.center.dataaccess.domain.SettleOrderDO;
import com.sztx.pay.center.dataaccess.entity.QuerySettle;
import com.sztx.se.dataaccess.mysql.BaseMysqlDAO;
import com.sztx.se.dataaccess.mysql.config.PageQuery;

public interface SettleOrderMysqlDAO extends BaseMysqlDAO<SettleOrderDO> {
	
	public int saveAll(List<SettleOrderDO> orders);
	
	public int updateHandlingFeeResult(@Param("settleOrderId")String settleOrderId, @Param("state")int state);
	
	public void updateState(@Param("settleOrderId")String settleOrderId, @Param("state")int state);
	
	public void updateSettleResult(@Param("settleOrderId")String settleOrderId, @Param("payFlowNo")String payFlowNo, @Param("fundsToAccount")long fundsToAccount, @Param("fundsToTime")Date fundsToTime, @Param("state")int state, @Param("settleResultMsg")String settleResultMsg);
	
	public List<SettleOrderDO> getSettleLaterOrders(@Param("settleTime")Date settleTime, @Param("pageQuery")PageQuery page);
	
	public int countSettleLaterOrders(@Param("settleTime")Date settleTime);
	
	public List<String> getCallBackOrderIds(List<String> settleOrderIds);
	
	public List<SettleOrderDO> getSettleOrdersByOrderId(@Param("orderId")String orderId);
	
	public SettleOrderDO getSettleOrderBySettleOrderId(@Param("settleOrderId")String settleOrderId);
	
	int countSettleOrder(QuerySettle query);
	
	List<SettleOrderDO> findSettleOrder(@Param("settleOrder") QuerySettle query, @Param("pageQuery") PageQuery pageQuery);
	
	public void updateStateByOrderId(@Param("orderId")String orderId, @Param("state")int state);

	public void updateSettleResultByOrderId(@Param("orderId")String orderId, @Param("fundsToTime")Date fundsToTime, @Param("state")int state, @Param("settleResultMsg")String settleResultMsg);
	
	void deleteDumpCount(@Param("startTime") String startTime, @Param("endTime") String endTime);
}